import os
import shutil
import pathlib


def create_model_dir(path: str | pathlib.Path):
    if not os.path.exists(path):
        os.makedirs(path)
        return path


def remove_dir(path: str | pathlib.Path):
    if os.path.exists(path):
        shutil.rmtree(path)
        return path


def get_model_folders(path: str | pathlib.Path):
    return sorted(
        [
            name for name in os.listdir(path)
            if os.path.isdir(os.path.join(path, name)) and not name.startswith('.')
        ])
